package 策略模式.简单工厂模式实现;

import 策略模式.简单工厂模式加策略模式.Payment;

/**
 * 文 件 名 称：Reduce.
 * 文 件 说 明：满立减
 * 创   建   人：zpen.
 * 创 建 时 间：2018/5/3 16:07.
 */
public class Reduce implements Payment {
    private Integer total;
    private Integer satisfy;
    private Integer reduce;

    public Reduce(Integer total, Integer satisfy, Integer reduce) {
        this.total = total;
        this.satisfy = satisfy;
        this.reduce = reduce;
    }

    public Reduce() {
    }

    public Integer getTotal() {
        return total;
    }

    public void setTotal(Integer total) {
        this.total = total;
    }

    public Integer getSatisfy() {
        return satisfy;
    }

    public void setSatisfy(Integer satisfy) {
        this.satisfy = satisfy;
    }

    public Integer getReduce() {
        return reduce;
    }

    public void setReduce(Integer reduce) {
        this.reduce = reduce;
    }

    @Override
     public Double getTotals(){
        return Double.valueOf(total-total/satisfy*reduce);
    }
}
